﻿<div id="content">
    <!-- widget grid -->
    <section id="widget-grid" widget-grid>
        <!-- start row -->
        <div class="row">
            <h1 class="margin-bottom-30 margin-top-0 clearfix">
                <div class="col-sm-2">
                    <select class="form-control" ng-model="role_id" ng-change="sel_rol()">
                        <option class="role" value="0">选择角色</option>
                        <option class="role" ng-repeat="list in roles" value="{{list.id}}">{{list.name}}</option>
                    </select>
                </div>
            </h1>
           
            <article class="col-sm-12 col-md-12 col-lg-12 ">
                <!-- Widget ID (each widget will need unique ID)-->
                <div data-widget-editbutton="false " data-widget-color="darken " data-widget-deletebutton="false " data-jarvis-widget>               
                    <header>
                        <span class="widget-icon "> <i class="fa fa-lg fa-pencil-square-o "></i> </span>
                        <h2>编辑动作权限</h2>
                    </header>
                    <!-- widget div-->
                    <div role="content">
                        <!-- widget content -->
                        <div class="widget-body ">
                            <form class="smart-form ng-pristine ng-valid ">
                                <table class="table table-bordered table-responsive table-hover son">
                                    <thead>
                                        <th class="text-center">项目名称</th>
                                        <th class="text-center" ng-repeat="action in actions">
                                            {{action.name}}
                                        </th>
                                    </thead>
                                    <tbody>
                                        <tr ng-repeat="pro in projects" class="text-center">
                                            <td>{{pro.name}}</td>
                                            <td ng-repeat="action in actions">
                                                <label>
                                                    <input class="checkbox style-0 project{{pro.id}}" type="checkbox"  ng-model="x"  ng-checked="master">
                                                    <span style="margin: 0px 0px 2px 2px;width: 17px;"></span>
                                                </label>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </form>

                        </div>

                        <div class="widget-footer">
                            <div class="col-xs-6 col-sm-4 col-md-4 ng-scope">
                                <label class="checkbox-inline">
                                    <input type="checkbox" class="checkbox style-0" type="checkbox" ng-model="master" ng-click="selectAll(master)">
                                    <span>全选</span>
                                </label>
                            </div>
                            <button class="btn btn-sm btn-primary" type="button" ng-click="submit_data()">提交</button>
                        </div>
                    </div>
                    <!-- end widget content -->
                </div>
                <!-- end widget div -->
                <!-- end widget -->
            </article>

        </div>
        <!-- end row -->

    </section>

</div>
<div class="modal fade in" id="infoAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    ×
                </button>
                <h4 class="modal-title">信息</h4>
            </div>
            <div class="modal-body">
                <p>
                    您未选择正确的角色！！！
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" data-dismiss="modal">
                    确认
                </button>
            </div>
        </div>
    </div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->